fix!: type the Actor run input on ActorClient and RunClient - #1040
Merged
Conversation
Contributor
|
See more at https://github.com/apify/apify-client-js/actions/runs/34450291289#summary-102784316437 |
BREAKING CHANGE: `ActorClient.start()`, `call()` and `validateInput()` take `input` as `ActorInput` (`object | string`) instead of `unknown`. A number, a boolean or `null` no longer compiles. Omit the argument or pass `undefined` to run without input. Closes #818
BREAKING CHANGE: `RunClient.metamorph()` takes `input` as an optional `ActorInput` (`object | string`) instead of a required `unknown`. A number, a boolean or `null` no longer compiles.
vdusek
force-pushed
the
fix/actor-input-type
branch
from
September 8, 2026 10:22
4c68507 to
6d5c76a
Compare
janbuchar
approved these changes
Sep 9, 2026
This was referenced Sep 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ActorClient.start(),call(),validateInput()andRunClient.metamorph()tookinputasunknown, so anything compiled, including values the client can't send. They now takeActorInput, an alias forobject: a JSON-serializable object or array. A string, a number, a boolean,nulland values typedunknownstop compiling. Nothing changes at runtime.metamorph()'sinputbecomes optional too.The raw
stringbody that v2 accepted alongsidecontentTypeis left out on purpose, as non-JSON Actor input is being sunset. ThecontentTypeoption itself stays.The issue asked for
Dictionary, the typeTaskClientuses. That rejects anything typed by your owninterface, which gets no index signature. Task input keepsDictionarybecause its overrides merge into the input saved on the task.The
ActorStandbyfields from the issue's second comment are already onv3via #985.apify-sdk-jsforwardsinput?: unknowninto this client, so it needs the same retyping before it bumps.Closes #818
✍️ Drafted by Claude Code